﻿ {include file="public/header" /}
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">基础信息</a>
        <a>
          <cite>材料截面</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <xblock>
        <a class="layui-btn"  target="_blank" href="{:url()}"><i class="iconfont">&#xe718;</i> 框架页面</a>

        <button class="layui-btn" onclick="x_admin_show('添加横截','{:url(\'index/Section/sectionAdd\')}',700,400)"><i class="layui-icon"></i>添加</button>
        <!--<span class="x-right" style="line-height:40px">共有数据：88 条</span>-->
      </xblock>
      <div class="container-wrap">
        <div class="box-1">
          <table class="layui-table">
            <thead>
            <tr>
              <th  >操作</th>
              <th >规格</th>
            <th>尺寸</th>
            <th   style="text-align: right">截面积</th>
            </tr>
        <tbody>
        {volist name="sectionInfo" id="info"}
          <tr>

            <td class="td-manage" width="50px;">
              <a title="编辑"onclick="x_admin_show('修改操作','{:url(\'index/Section/sectionEdit\',[\'id\'=>$info.id])}',700,400)" href="javascript:;">
                <i style="color: green" class="layui-icon"></i>
              </a>
              <a title="删除" onclick="delete_(this,'{$info.id}')" href="javascript:void(0);" >
                <i  style="color:red;" class="layui-icon"></i>
              </a>
            </td>
            <td >{$info.spec}</td>
            <td >{$info.size}</td>
            <td style="text-align: right">{$info.weight}</td>
          </tr>
        {/volist}
        </tbody>
      </table>
        </div>
      </div>
      <div class="page">
        {$sectionInfo|raw}
      </div>
    </div>
    <script>

        /*删除*/
        function delete_(obj,id){
            layer.confirm('确认要删除吗？',function(index){
                var url = "{:url('/index/Section/delete')}";
                var postData ={"id":id};
                $.post(url,postData,function (result) {
                    if(result === 1 ){
                        $(obj).parents("tr").remove();
                        layer.msg('已删除!',{icon:1,time:1000});
                    }else {
                        layer.alert("删除失败", {icon: 5});
                    }
                },"json");
            });
        }
    </script>
  </body>
</html>